package cn.tedu.ivos.audit.controller;

import cn.tedu.ivos.audit.pojo.dto.AuditQuery;
import cn.tedu.ivos.audit.pojo.dto.AuditSaveParam;
import cn.tedu.ivos.audit.pojo.vo.AuditVO;
import cn.tedu.ivos.audit.service.AuditService;
import cn.tedu.ivos.base.response.JsonResult;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@Tag(name = "审批模块")
@Slf4j
@RequestMapping("/v1/audit")
public class AuditController {
    @Autowired
    AuditService aservice;
    @ApiOperationSupport(order = 10)
    @Operation(description = "审批列表")
    @GetMapping("select")
    public JsonResult selectAudit(AuditQuery query){
        List<AuditVO>list = aservice.selectAudit(query);
        return JsonResult.ok(list);
    }
    @ApiOperationSupport(order = 20)
    @Operation(description = "更新审批")
    @PostMapping("update")
    public JsonResult updateAudit(AuditSaveParam param){
        log.debug("param:{}",param);
        aservice.updateAudit(param);
        return JsonResult.ok();
    }
}
